package com.danbay.cloud.base.constants;


/**
 * 水表报警信息
 * @author SJG
 * 2017/11/22
 */
public enum WmWarning {
    LEAK(0x001,"漏水异常报警"),
    VALVE_OPEN(0x002,"阀门未关报警"),
    TAMPER(0x003,"防拆报警"),
    LOW_CURRENT(0x004,"低电报警");

    private final int value;
    private final String phrase;

    WmWarning(int value , String phrase){
        this.value = value;
        this.phrase = phrase;
    }

    public int value(){
        return value;
    }

    public static String getPhrase(int value){
        for(WmWarning t : values()){
            if(t.value == value){
                return t.phrase;
            }
        }
        return "错误状态";
    }
}